package com.guang.springbootmybatisautogenerate.page.bean;

import org.apache.ibatis.session.RowBounds;

public class PagingRowBounds extends RowBounds {
    private final int startRowNum;
    private final int endRowNum;
    private final int currPage;
    private final int pageSize;

    public PagingRowBounds(int currPage, int pageSize) {
        this.currPage = currPage;
        this.pageSize = pageSize;
        this.startRowNum = (currPage - 1) * pageSize + 1;
        this.endRowNum = currPage * pageSize;
    }

    public int getStartRowNum() {
        return this.startRowNum;
    }

    public int getEndRowNum() {
        return this.endRowNum;
    }

    public int getCurrPage() {
        return this.currPage;
    }

    public int getPageSize() {
        return this.pageSize;
    }
}